package com.scs.application.modules.base.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @ClassName WinBiddingResultDTO
 */
@Data
@NoArgsConstructor
@Valid
@Accessors(chain = true)
public class WinBiddingResultDTO {

    @NotBlank(message = "参考单据ID不能为空")
    private String refId;

    @Valid
    @NotNull(message = "中标明细不能为空")
    @Size(min = 1, message = "中标明细不能为空")
    private List<Item> items;

    @Data
    public static class Item {

        /**
         * 参考单据ID  SPD系统中询价明细ID
         */
        @NotBlank(message = "参考单据id不能为空")
        private String itemRefId;

        /**
         * 供应商编码
         */
        private String supplierCode;

        @NotBlank(message = "供应商名称不能为空")
        private String supplierName;

        /**
         * 中标价格
         */
        @NotNull(message = "中标价格不能为空")
        private Double skuOfficialPrice;

        /**
         * 中标价来源
         */
//        @NotBlank(message = "中标价来源不能为空")
        private String skuOfficialPriceSrc;
    }
}

